Skip to content

Conversation

tsmaeder
Copy link
Contributor

Adds code to forward "project import" telemetry from LS and adds a hash of the workspace folders to the all telemetry messages.

Fixes #4175

Companion PR to eclipse-jdtls/eclipse.jdt.ls#3544

How to test: I could only test this in the debugger since I don't have access to the telemetry data buckets.

return Telemetry.sendTelemetry(Telemetry.LS_ERROR, e.properties);
await Telemetry.sendTelemetry(Telemetry.LS_ERROR, e.properties);
}
} else if (e.name === Telemetry.IMPORT_PROJECT) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now can we skip this event and just send the workspace hash to the telemetry service?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of the event is to know how many import runs catastrophically fail and why. How would we know that if we don't report it to telemetry?

@tsmaeder tsmaeder force-pushed the 4175_telemetry_improvements branch from 41ab508 to c8298b0 Compare October 21, 2025 13:56
const javaSettings = getJavaSettingsForTelemetry(workspace.getConfiguration());

const properties= { ...e.properties, ...javaSettings };
await Telemetry.sendTelemetry(Telemetry.STARTUP_EVT, );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should really send those properties ;-)

Signed-off-by: Thomas Mäder <[email protected]>
@tsmaeder tsmaeder force-pushed the 4175_telemetry_improvements branch from 29b6f3d to 3c556e2 Compare October 21, 2025 14:49
*/
export async function sendTelemetry(eventName: string, data?: any): Promise<void> {
export async function sendTelemetry(eventName: string, data?: object): Promise<void> {
console.log(`Sending telemetry event: ${eventName} with data: ${JSON.stringify(data)}`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary as we already have logging from vscode-redhat-telemetry. If you don't see it in your debug console, make sure you run npm ci to see the latest version.

export const COMPLETION_EVENT = "textCompletion";
export const SERVER_INITIALIZED_EVT = "java.workspace.initialized";
export const LS_ERROR = "java.ls.error";
export const IMPORT_PROJECT = "java.workspace.importProject";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send Workspace Identifier with Telemetry

2 participants